package com.qf.controller;

import com.qf.dto.UserDTO;
import com.qf.vo.UserVO;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


/**
 * @author zjw
 * @description
 * @date 2021/10/8$ 15:44$
 */

@RequestMapping("/json")
@RestController       //  @Controller + @ResponseBody
public class JSONController {

    @RequestMapping(value = "/test")
    public UserVO test(@RequestBody UserDTO userDTO){

        UserVO userVO = new UserVO();

        BeanUtils.copyProperties(userDTO,userVO);
        userVO.setGender(1);

        return userVO;
    }



}
